<template>
  <div class="app">
    <van-nav-bar
      title="退款/售后"
      left-text=""
      left-arrow
      @click="backlink()"
    />
    <div class="goodscontainer">
      <div class="goodscard" v-for="(item, index) in refundlist" :key="index">
        <div class="store_name">
          <div>
            {{ item.store_name }}
            <van-icon name="arrow" style="font-size: 16px" />
          </div>
          <div>退款</div>
        </div>
        <div class="goodsinfo">
          <div class="goodsimg">
            <img :src="item.goodsimg" alt="" />
          </div>
          <div class="info">
            <div class="info1">
              <van-text-ellipsis class="goodsname" :content="item.goodsname" />
              <div class="goodsinfo1">{{ item.goodsinfo }}</div>
            </div>
            <div class="goodsprice">退款：￥{{ item.price }}</div>
          </div>
        </div>
        <div class="jieguobox">
          <div
            v-if="item.status == 0"
            style="display: flex; font-size: 17px; align-items: center"
          >
            退款成功
            <div style="margin-left: 10px; font-size: 16px">
              退款：￥{{ item.price }}
            </div>
          </div>
        </div>
        <div style="display: flex; justify-content: flex-end; margin-top: 5px">
          <van-button class="chakanbtn1" @click="gotolinkwithdata(item)"
            >查看详情</van-button
          >
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      refundlist: [
        {
          store_name: "店铺名",
          goodsimg: require("../../assets/images/club1.jpg"),
          goodsname: "商品名称",
          goodsinfo: "颜色信息",
          price: "100",
          status: 0,
          refund_id: "7823712037120731",
          refundreason: "退款1",
          applytime: "2024-02-24 16:06:22",
          tuikuantime: "2024-02-26 16:06:22",
        },
        {
          store_name: "店铺名",
          goodsimg: require("../../assets/images/club2.jpg"),
          goodsname: "商品名称",
          goodsinfo: "颜色信息",
          price: "10",
          status: 0,
          refund_id: "7823712037120731",
          refundreason: "退款2",
          applytime: "2024-02-24 16:06:22",
          tuikuantime: "2024-02-26 16:06:22",
        },
      ],
    };
  },
  methods: {
    backlink() {
      this.$router.back();
    },
    gotolinkwithdata(item) {
      this.$router.push({
        name: "RefundDetail",
        params: {
          refundinfo: JSON.stringify(item),
        },
      });
    },
  },
};
</script>

<style scoped>
.app {
  margin: 0;
  padding: 0;
  background-color: #f5f3f3;
  min-height: 100vh;
}
.goodscontainer {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.goodscard {
  width: 100%;
  border-radius: 15px;
  box-sizing: border-box;
  padding: 15px;
  background-color: white;
  margin-top: 10px;
  display: flex;
  flex-direction: column;
}
.store_name {
  width: 100%;
  display: flex;
  font-size: 16px;
  justify-content: space-between;
  align-items: center;
}
.goodsinfo {
  display: flex;
  margin-top: 10px;
  height: 80px;
  align-items: center;
}
.goodsimg {
  width: 70px;
  height: 70px;
  border-radius: 10px;
  overflow: hidden;
}
.goodsimg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.info {
  margin-left: 5px;
  display: flex;
  flex-grow: 1;
  height: 100%;
  flex-direction: column;
  justify-content: space-between;
}
.info1 {
  display: flex;
  flex-direction: column;
}
.goodsname {
  min-width: 90%;
  font-size: 17px;
}
.goodsinfo1 {
  font-size: 13px;
  color: gray;
}
.goodsprice {
  font-size: 17px;
}
.jieguobox {
  width: 100%;
  margin: 5px auto;
  background-color: #f5f3f3;
  box-sizing: border-box;
  padding: 8px;
  border-radius: 5px;
}
.chakanbtn1 {
  width: 100px;
  height: 30px;
  border-radius: 25px;
}
</style>